package com.mvd.app.activity;

import android.app.DatePickerDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.text.InputType;
import android.text.TextUtils;
import android.view.View;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;

import com.google.gson.Gson;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.callback.StringCallback;
import com.lzy.okgo.model.Response;
import com.lzy.okgo.request.base.Request;
import com.mvd.app.R;
import com.mvd.app.adapter.RecheckCarsListAdapter;
import com.mvd.app.application.BaseApplication;
import com.mvd.app.commons.CommonUtils;
import com.mvd.app.commons.DateUtil;
import com.mvd.app.commons.JsonUtil;
import com.mvd.app.commons.PDALogUtils;
import com.mvd.app.commons.SharedPreferencesUtils;
import com.mvd.app.commons.UtilsLog;
import com.mvd.app.model.CarsInforModel;
import com.mvd.app.model.CarsInforModel_RiZhao;
import com.mvd.app.model.RecheckCarsModel;
import com.mvd.app.model.RecheckJsonModel;
import com.mvd.app.widget.EditTextViewWorksSizeCheckUtil;
import com.mvd.app.widget.IEditTextChangeListener;

import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 复检拍照,查询  车辆列表
 */
public class RecheckPhotoListActivity extends BaseActivity implements AdapterView.OnItemClickListener {

    @BindView(R.id.ac_rechreck_list)
    ListView acRechreckList;
    public RecheckPhotoListActivity instances = null;
    @BindView(R.id.ac_daijian_et_search22)
    EditText acDaijianEtSearch22;
    @BindView(R.id.ac_recheck_start_time)
    TextView acRecheckStartTime;
    @BindView(R.id.ac_recheck_end_time)
    TextView acRecheckEndTime;
    @BindView(R.id.ac_daijian_btn_search22)
    Button acDaijianBtnSearch22;
    @BindView(R.id.ac_daijian_bt_type22)
    Button acDaijianBtType22;

    private String carNO = null;
    private String StartTime = null;
    private String EndTime = null;
    private int CHECK_MODE = 0;//检测模式 0:外检  1：路试 2：底盘动态
    private String CURRENT_CHECK_MODE = "";//当前检测模式

    final Calendar ca = Calendar.getInstance();
    int mYear, mMonth, mDay;
    final int DATE_DIALOG = 1;
    final int DATE_DIALOG2 = 2;

    RecheckJsonModel recheckJsonModel;//复检查询上传json用到

    //    List<RecheckCarsModel> recheckCarsModelList = new ArrayList<>();//复检查询到的车辆列表
//    List<RecheckCarsModel> filtering_recheckCarsModelList = new ArrayList<>();//复检查询到的车辆列表-过滤后的
    RecheckCarsListAdapter recheckCarsListAdapter;


    //日照的
    private List<CarsInforModel_RiZhao> riZhao_carsInforModelList = new ArrayList<CarsInforModel_RiZhao>();
    private List<CarsInforModel> carsInforModelList = new ArrayList<CarsInforModel>();

    private String Login_name = "", login_IDNumber;//当前登录的检测员的名字

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
//        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
        setContentView(R.layout.activity_recheck_photo);
        ButterKnife.bind(this);
        acRechreckList.setOnItemClickListener(this);
        setTopTitle(R.string.activity_daijian_car_list);
        instances = this;
        setBackBtn();

        login_IDNumber = getIntent().getExtras().getString("login_IDNumber", "");
        Login_name = getIntent().getExtras().getString("Login_name", "");

        CHECK_MODE = BaseApplication.JIANCE_MODE;
        switch (BaseApplication.JIANCE_MODE) {
            //检测模式 0:外检  F1 1：路试 R1 2：底盘动态 DC
            case 0:
                CURRENT_CHECK_MODE = "F1";
                break;
            case 1:
                CURRENT_CHECK_MODE = "R1";
                break;
            case 2:
                CURRENT_CHECK_MODE = "DC";
                break;
        }
        mYear = ca.get(Calendar.YEAR);
        mMonth = ca.get(Calendar.MONTH);
        mDay = ca.get(Calendar.DAY_OF_MONTH);

        acRecheckStartTime.setText(DateUtil.getTodayDate2());
        acRecheckEndTime.setText(DateUtil.getTodayDate2());
        recheckJsonModel = new RecheckJsonModel();
        acRechreckList.setVisibility(View.GONE);

//        acDaijianEtSearch22.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_NORMAL);

//        acDaijianEtSearch22.requestFocus();
//        InputMethodManager inputMethodManager = (InputMethodManager) instances.getSystemService(Context.INPUT_METHOD_SERVICE);
////        inputMethodManager.showSoftInput(acDaijianEtSearch22, InputMethodManager.SHOW_IMPLICIT);
//        inputMethodManager.toggleSoftInput(0, InputMethodManager.SHOW_FORCED);


//        //1.创建工具类对象 把要改变颜色的tv先传过去
//        EditTextViewWorksSizeCheckUtil.textChangeListener textChangeListener = new
//                EditTextViewWorksSizeCheckUtil.textChangeListener(acDaijianBtnSearch22);
//
//        //2.把所有要监听的edittext都添加进去
//        textChangeListener.addAllEditText(acDaijianEtSearch22);
//
//        //3.接口回调 在这里拿到boolean变量 根据isHasContent的值决定 tv 应该设置什么颜色
//        EditTextViewWorksSizeCheckUtil.setChangeListener(new IEditTextChangeListener() {
//            @Override
//            public void textChange(boolean isHasContent) {
//                if (isHasContent) {
//                    acDaijianBtnSearch22.setTextColor(Color.WHITE);
//                    acDaijianBtnSearch22.setEnabled(true);
//                } else {
//                    acDaijianBtnSearch22.setTextColor(Color.GRAY);
//                    acDaijianBtnSearch22.setEnabled(false);
//                }
//            }
//        });


//        Timer timer = new Timer();
//        timer.schedule(new TimerTask() {
//
//            public void run() {
//                InputMethodManager inputManager = (InputMethodManager) acDaijianEtSearch22.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
//                inputManager.showSoftInput(acDaijianEtSearch22, 0);
//            }
//
//        }, 800);
    }


    private void getData(int type, String str) {
        if (CommonUtils.isOnline(this)) {
            if (type == 0) {
                getDataSearchCarsByNO(str);
            }
        } else {
            Toast.makeText(this, getResources().getString(R.string.network_error), Toast.LENGTH_LONG)
                    .show();
        }
    }

    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
        CarsInforModel model = (CarsInforModel) parent.getAdapter().getItem(position);
        Intent intent2 = null;
        intent2 = new Intent(instances, ReCheckTakePhotoActivity.class);
        intent2.putExtra("re_model", model);
        intent2.putExtra("Login_name", Login_name);
        intent2.putExtra("login_IDNumber", login_IDNumber);
        startActivity(intent2);
    }

    @OnClick({R.id.ac_daijian_btn_search22, R.id.ac_recheck_start_time,
            R.id.ac_recheck_end_time, R.id.ac_daijian_et_search22})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.ac_daijian_btn_search22:
                //查询
                carNO = acDaijianEtSearch22.getText().toString().trim();
                StartTime = acRecheckStartTime.getText().toString().trim();
                EndTime = acRecheckEndTime.getText().toString().trim();
                if (!TextUtils.isEmpty(carNO)) {
                    recheckJsonModel.setPlateNO(carNO);
                    recheckJsonModel.setEndDate(EndTime);
                    recheckJsonModel.setStartDate(StartTime);
//                    recheckJsonModel.setType("0");
                    getData(0, carNO);

                } else {
                    Toast.makeText(instances, "车牌号码不能为空", Toast
                            .LENGTH_LONG).show();
                }
                break;
            case R.id.ac_recheck_start_time:
                //开始时间
                showDialog(DATE_DIALOG);
                break;
            case R.id.ac_recheck_end_time:
                //结束时间
                showDialog(DATE_DIALOG2);
                break;
//            case R.id.ac_daijian_et_search22:
//                //输入框，软键盘
//                showSoftInputFromWindow(acDaijianEtSearch22);
////                acDaijianEtSearch22.setFocusable(true);
//                break;
        }
    }

    @Override
    protected Dialog onCreateDialog(int id) {
        switch (id) {
            case DATE_DIALOG:
                return new DatePickerDialog(this, mdateListener, mYear, mMonth, mDay);
            case DATE_DIALOG2:
                return new DatePickerDialog(this, mdateListener2, mYear, mMonth, mDay);
        }
        return null;
    }

    /**
     * 设置日期 利用StringBuffer追加
     */
    public void display(TextView tv) {
        tv.setText(new StringBuffer().append(mYear).append("-").append(mMonth + 1).append("-").append(mDay)
                .append(" "));
    }

    private DatePickerDialog.OnDateSetListener mdateListener = new DatePickerDialog.OnDateSetListener() {

        @Override
        public void onDateSet(DatePicker view, int year, int monthOfYear,
                              int dayOfMonth) {
            mYear = year;
            mMonth = monthOfYear;
            mDay = dayOfMonth;
            display(acRecheckStartTime);
        }
    };
    private DatePickerDialog.OnDateSetListener mdateListener2 = new DatePickerDialog.OnDateSetListener() {

        @Override
        public void onDateSet(DatePicker view, int year, int monthOfYear,
                              int dayOfMonth) {
            mYear = year;
            mMonth = monthOfYear;
            mDay = dayOfMonth;
            display(acRecheckEndTime);
        }
    };

    @Override
    protected void onDestroy() {
        super.onDestroy();
        OkGo.getInstance().cancelTag(this);
        instances = null;
    }

    //复检查询
    //carNO 车牌号码
    private void getDataSearchCarsByNO(String carNO) {
        Gson gson = new Gson();
        String json_str = gson.toJson(recheckJsonModel);
        String logStr = "\n" + "补传照片搜车列表----参数" +
                "\n" + "json::" + recheckJsonModel.toString() + "\n" + "url" +
                SharedPreferencesUtils.getIP(this) + RECHECK_CARS_LIST;
        PDALogUtils.createLogFile(32, logStr.getBytes());
        UtilsLog.e("getDataSearchCarsByNO---json_str==" + json_str);
        UtilsLog.e("getDataSearchCarsByNO---url==" + SharedPreferencesUtils.getIP(this) + RECHECK_CARS_LIST);
        OkGo.<String>post(SharedPreferencesUtils.getIP(this) + RECHECK_CARS_LIST).tag(this)
                .upJson(json_str)
                .execute(new StringCallback() {
                    @Override
                    public void onStart(Request<String, ? extends Request> request) {
                        super.onStart(request);
                        CommonUtils.showLoadingDialog(instances, "加载中...");
                    }

                    @Override
                    public void onSuccess(Response<String> response) {
                        String result = response.body();
                        String logStr = "\n" + "补传照片搜车列表----onSuccess" +
                                "\n" + "result::" + result + "\n";
                        PDALogUtils.createLogFile(32, logStr.getBytes());
//                        UtilsLog.e("getDataSearchCarsByNO-result==" + result);
//                        String newResult = result.substring(1, result.length() - 1).replaceAll("\\\\", "");
                        String newResult = result;
                        UtilsLog.e("getDataSearchCarsByNO-newResult==" + newResult);
                        if (!TextUtils.isEmpty(newResult) && !"[[]]".equals(newResult) && !"[{}]".equals
                                (newResult) && !"[]".equals(newResult)) {
//                            recheckCarsModelList = new ArrayList<RecheckCarsModel>();
//                            filtering_recheckCarsModelList = new ArrayList<RecheckCarsModel>();
//                            recheckCarsModelList = JsonUtil.stringToArray(newResult, RecheckCarsModel[]
//                                    .class);

                            riZhao_carsInforModelList = new ArrayList<CarsInforModel_RiZhao>();
                            riZhao_carsInforModelList = JsonUtil.stringToArray(newResult, CarsInforModel_RiZhao[].class);

                            if (riZhao_carsInforModelList != null && riZhao_carsInforModelList.size() > 0) {
//                                for (int i = 0; i < recheckCarsModelList.size(); i++) {
////                                    if(recheckCarsModelList.get(i).getDetectionStatus()==2||recheckCarsModelList.get(i).getDetectionStatus()==3){
//                                    filtering_recheckCarsModelList.add(recheckCarsModelList.get(i));
////                                    }
//                                }
                                carsInforModelList = changeModelData(riZhao_carsInforModelList);
//                                if (filtering_recheckCarsModelList != null && filtering_recheckCarsModelList.size() > 0) {

                                recheckCarsListAdapter = new RecheckCarsListAdapter(RecheckPhotoListActivity.this,
                                        carsInforModelList);
                                acRechreckList.setAdapter(recheckCarsListAdapter);
//                                } else {
//                                    Toast.makeText(instances, "没有查询到相关车辆", Toast
//                                            .LENGTH_LONG).show();
//                                }
                                acRechreckList.setVisibility(View.VISIBLE);
                            } else {
                                acRechreckList.setVisibility(View.GONE);
                                Toast.makeText(instances, "没有查询到相关车辆", Toast
                                        .LENGTH_LONG).show();
                            }

                        } else {
                            acRechreckList.setVisibility(View.GONE);
                            UtilsLog.e("getDataSearchCarsByNO-result==" + "没有数据");
                            Toast.makeText(instances, "没有查询到相关车辆", Toast
                                    .LENGTH_LONG).show();
                        }
                        CommonUtils.hideLoadingDialog(instances);
                    }

                    @Override
                    public void onError(Response<String> response) {
                        super.onError(response);
                        String logStr = "\n" + "补传照片搜车列表----onError" +
                                "\n" + "result::" + response.body() + "\n";
                        PDALogUtils.createLogFile(32, logStr.getBytes());
                        UtilsLog.e("getDataSearchCarsByNO-onError==" + response.body());
                        CommonUtils.hideLoadingDialog(instances);
                    }
                });
    }

    private List<CarsInforModel> changeModelData(List<CarsInforModel_RiZhao> riZhaoList) {
        List<CarsInforModel> carList = new ArrayList<>();
        CarsInforModel model = null;
        for (int i = 0; i < riZhaoList.size(); i++) {
            model = new CarsInforModel();
            model.setVehicleInfoID(riZhaoList.get(i).getVehicleInfo().getVehicleInfoID() != null ? riZhaoList.get(i).getVehicleInfo().getVehicleInfoID() : "");
            model.setPlateNO(riZhaoList.get(i).getVehicleInfo().getPlateNO() != null ? riZhaoList.get(i).getVehicleInfo().getPlateNO() : "");
            model.setPlateType(riZhaoList.get(i).getVehicleInfo().getPlateType() != null ? riZhaoList.get(i).getVehicleInfo().getPlateType() : "");
            model.setPlateColor(riZhaoList.get(i).getVehicleInfo().getPlateColor() != null ? riZhaoList.get(i).getVehicleInfo().getPlateColor() : "");
            model.setVIN(riZhaoList.get(i).getVehicleInfo().getVIN() != null ? riZhaoList.get(i).getVehicleInfo().getVIN() : "");
            model.setOwner(riZhaoList.get(i).getVehicleInfo().getOwner() != null ? riZhaoList.get(i).getVehicleInfo().getOwner() : "");
            model.setAddress(riZhaoList.get(i).getVehicleInfo().getAddress() != null ? riZhaoList.get(i).getVehicleInfo().getAddress() : "");
            model.setTelephone(riZhaoList.get(i).getVehicleInfo().getTelephone() != null ? riZhaoList.get(i).getVehicleInfo().getTelephone() : "");
            model.setArea(riZhaoList.get(i).getVehicleInfo().getArea() != null ? riZhaoList.get(i).getVehicleInfo().getArea() : "");
            model.setVehicleType(riZhaoList.get(i).getVehicleInfo().getVehicleType() != null ? riZhaoList.get(i).getVehicleInfo().getVehicleType() : "");
            model.setBrand(riZhaoList.get(i).getVehicleInfo().getBrand() != null ? riZhaoList.get(i).getVehicleInfo().getBrand() : "");
            model.setCarModel(riZhaoList.get(i).getVehicleInfo().getCarModel() != null ? riZhaoList.get(i).getVehicleInfo().getCarModel() : "");
            model.setEngineNO(riZhaoList.get(i).getVehicleInfo().getEngineNO() != null ? riZhaoList.get(i).getVehicleInfo().getEngineNO() : "");
            model.setEngineModel(riZhaoList.get(i).getVehicleInfo().getEngineModel() != null ? riZhaoList.get(i).getVehicleInfo().getEngineModel() : "");
            model.setProductionDate(riZhaoList.get(i).getVehicleInfo().getProductionDate() != null ? riZhaoList.get(i).getVehicleInfo().getProductionDate() : "");
            model.setRegisteDate(riZhaoList.get(i).getVehicleInfo().getRegisteDate() != null ? riZhaoList.get(i).getVehicleInfo().getRegisteDate() : "");
            model.setTotalMass(riZhaoList.get(i).getVehicleInfo().getTotalMass() != null ? riZhaoList.get(i).getVehicleInfo().getTotalMass() : "");
            model.setCurbWeight(riZhaoList.get(i).getVehicleInfo().getCurbWeight() != null ? riZhaoList.get(i).getVehicleInfo().getCurbWeight() : "");
            model.setApprovedLoad(riZhaoList.get(i).getVehicleInfo().getApprovedLoad() != null ? riZhaoList.get(i).getVehicleInfo().getApprovedLoad() : "");
            model.setUseProperty(riZhaoList.get(i).getVehicleInfo().getUseProperty() != null ? riZhaoList.get(i).getVehicleInfo().getUseProperty() : "");
            model.setCategory(riZhaoList.get(i).getVehicleInfo().getCategory() != null ? riZhaoList.get(i).getVehicleInfo().getCategory() : "");
            model.setUsage(riZhaoList.get(i).getVehicleInfo().getUsage() != null ? riZhaoList.get(i).getVehicleInfo().getUsage() : "");
            model.setUseAttribute(riZhaoList.get(i).getVehicleInfo().getUseAttribute() != null ? riZhaoList.get(i).getVehicleInfo().getUseAttribute() : "");
            model.setExpirationDate(riZhaoList.get(i).getVehicleInfo().getExpirationDate() != null ? riZhaoList.get(i).getVehicleInfo().getExpirationDate() : "");
            model.setLatestDate(riZhaoList.get(i).getVehicleInfo().getLatestDate() != null ? riZhaoList.get(i).getVehicleInfo().getLatestDate() : "");
            model.setScrapDate(riZhaoList.get(i).getVehicleInfo().getScrapDate() != null ? riZhaoList.get(i).getVehicleInfo().getScrapDate() : "");
            model.setValidTill(riZhaoList.get(i).getVehicleInfo().getValidTill() != null ? riZhaoList.get(i).getVehicleInfo().getValidTill() : "");
            model.setFuelType(riZhaoList.get(i).getVehicleInfo().getFuelType() != null ? riZhaoList.get(i).getVehicleInfo().getFuelType() : "");
            model.setFuelModel(riZhaoList.get(i).getVehicleInfo().getFuelModel() != null ? riZhaoList.get(i).getVehicleInfo().getFuelModel() : "");
            model.setDisplacement(riZhaoList.get(i).getVehicleInfo().getDisplacement() != null ? riZhaoList.get(i).getVehicleInfo().getDisplacement() : "");
            model.setPower(riZhaoList.get(i).getVehicleInfo().getPower() != null ? riZhaoList.get(i).getVehicleInfo().getPower() : "");
            model.setParkingAxle(riZhaoList.get(i).getVehicleInfo().getParkingAxle() != null ? riZhaoList.get(i).getVehicleInfo().getParkingAxle() : "");
            model.setWheelBase(riZhaoList.get(i).getVehicleInfo().getWheelBase() != null ? riZhaoList.get(i).getVehicleInfo().getWheelBase() : "");
            model.setFrontTrack(riZhaoList.get(i).getVehicleInfo().getFrontTrack() != null ? riZhaoList.get(i).getVehicleInfo().getFrontTrack() : "");
            model.setRearTrack(riZhaoList.get(i).getVehicleInfo().getRearTrack() != null ? riZhaoList.get(i).getVehicleInfo().getRearTrack() : "");
            model.setOutlineLength(riZhaoList.get(i).getVehicleInfo().getOutlineLength() != null ? riZhaoList.get(i).getVehicleInfo().getOutlineLength() : "");
            model.setOutlineWidth(riZhaoList.get(i).getVehicleInfo().getOutlineWidth() != null ? riZhaoList.get(i).getVehicleInfo().getOutlineWidth() : "");
            model.setOutlineHeight(riZhaoList.get(i).getVehicleInfo().getOutlineHeight() != null ? riZhaoList.get(i).getVehicleInfo().getOutlineHeight() : "");
            model.setStatus(riZhaoList.get(i).getVehicleInfo().getStatus() != null ? riZhaoList.get(i).getVehicleInfo().getStatus() : "");
            model.setDriveAxle(riZhaoList.get(i).getVehicleInfo().getDriveAxle() != null ? riZhaoList.get(i).getVehicleInfo().getDriveAxle() : "");
            model.setBrakeForce(riZhaoList.get(i).getVehicleInfo().getBrakeForce() != null ? riZhaoList.get(i).getVehicleInfo().getBrakeForce() : "");
            model.setHeadlightSystem(riZhaoList.get(i).getVehicleInfo().getHeadlightSystem() != null ? riZhaoList.get(i).getVehicleInfo().getHeadlightSystem() : "");
            model.setHighbeamAdjust(riZhaoList.get(i).getVehicleInfo().getHighbeamAdjust() != null ? riZhaoList.get(i).getVehicleInfo().getHighbeamAdjust() : "");
            model.setSuspensionForm(riZhaoList.get(i).getVehicleInfo().getSuspensionForm() != null ? riZhaoList.get(i).getVehicleInfo().getSuspensionForm() : "");
            model.setOdometer(riZhaoList.get(i).getVehicleInfo().getOdometer() != null ? riZhaoList.get(i).getVehicleInfo().getOdometer() : "");
            model.setMainAxis(riZhaoList.get(i).getVehicleInfo().getMainAxis() != null ? riZhaoList.get(i).getVehicleInfo().getMainAxis() : "");
            model.setTotalAxis(riZhaoList.get(i).getVehicleInfo().getTotalAxis() != null ? riZhaoList.get(i).getVehicleInfo().getTotalAxis() : "");
            model.setParkingAxis(riZhaoList.get(i).getVehicleInfo().getParkingAxis() != null ? riZhaoList.get(i).getVehicleInfo().getParkingAxis() : "");
            model.setBodyColor(riZhaoList.get(i).getVehicleInfo().getBodyColor() != null ? riZhaoList.get(i).getVehicleInfo().getBodyColor() : "");
            model.setUnderpanType(riZhaoList.get(i).getVehicleInfo().getUnderpanType() != null ? riZhaoList.get(i).getVehicleInfo().getUnderpanType() : "");
            model.setDriverType(riZhaoList.get(i).getVehicleInfo().getDriverType() != null ? riZhaoList.get(i).getVehicleInfo().getDriverType() : "");
            model.setCentralAxle(riZhaoList.get(i).getVehicleInfo().getCentralAxle() != null ? riZhaoList.get(i).getVehicleInfo().getCentralAxle() : "");
            model.setMotoRate(riZhaoList.get(i).getVehicleInfo().getMotoRate() != null ? riZhaoList.get(i).getVehicleInfo().getMotoRate() : "");
            model.setDriverAxleWeight(riZhaoList.get(i).getVehicleInfo().getDriverAxleWeight() != null ? riZhaoList.get(i).getVehicleInfo().getDriverAxleWeight() : "");
            model.setTransmissionType(riZhaoList.get(i).getVehicleInfo().getTransmissionType() != null ? riZhaoList.get(i).getVehicleInfo().getTransmissionType() : "");
            model.setAirAdmission(riZhaoList.get(i).getVehicleInfo().getAirAdmission() != null ? riZhaoList.get(i).getVehicleInfo().getAirAdmission() : "");
            model.setFuelSupply(riZhaoList.get(i).getVehicleInfo().getFuelSupply() != null ? riZhaoList.get(i).getVehicleInfo().getFuelSupply() : "");
            model.setTurnAxis(riZhaoList.get(i).getVehicleInfo().getTurnAxis() != null ? riZhaoList.get(i).getVehicleInfo().getTurnAxis() : "");

            model.setDetectQueueID(riZhaoList.get(i).getDetectQueueID());
            model.setSN(riZhaoList.get(i).getSN());
            model.setTimes(riZhaoList.get(i).getTimes());
            model.setDetectStatus(riZhaoList.get(i).getDetectStatus());
            model.setDetectDate(riZhaoList.get(i).getDetectDate());
            model.setDetectCategory(riZhaoList.get(i).getDetectCategory());
            model.setLine(riZhaoList.get(i).getLine() != null ? riZhaoList.get(i).getLine() : "1");
            model.setLeadTruck(riZhaoList.get(i).getLeadTruck() != null ? riZhaoList.get(i).getLeadTruck() : "");
            model.setOperator(riZhaoList.get(i).getOperator());
            model.setAppearanceInspector(riZhaoList.get(i).getAppearanceInspector() != null ? riZhaoList.get(i).getAppearanceInspector() : "");
            model.setDynamicInspector(riZhaoList.get(i).getDynamicInspector() != null ? riZhaoList.get(i).getDynamicInspector() : "");
            model.setStaticInspector(riZhaoList.get(i).getStaticInspector() != null ? riZhaoList.get(i).getStaticInspector() : "");
            model.setPrintStatus(riZhaoList.get(i).getPrintStatus());
            model.setUploadStatus(riZhaoList.get(i).getUploadStatus());
            model.setVehicleID(Integer.valueOf(riZhaoList.get(i).getVehicleID()));
            carList.add(model);
        }

        String logStr = "\n" + "补传照片车辆列表--数据:" +
                "\n" + "carList::" + carList.toString();
        PDALogUtils.createLogFile(32, logStr.getBytes());
        return carList;
    }
}
